INCLUDE (FindPkgConfig)

PKG_CHECK_MODULES (LIBPANEL REQUIRED libpanelapplet-2.0)
PKG_CHECK_MODULES (LIBGLADE REQUIRED libglade-2.0)
PKG_CHECK_MODULES (LIBGIO REQUIRED gio-unix-2.0)
PKG_CHECK_MODULES (LIBGTKHOTKEY gtkhotkey-1.0)

INCLUDE_DIRECTORIES (${LIBPANEL_INCLUDE_DIRS}
					 ${LIBGLADE_INCLUDE_DIRS}
					 ${LIBGIO_INCLUDE_DIRS})

LINK_DIRECTORIES (${LIBPANEL_LIBRARY_DIRS}
				  ${LIBGLADE_LIBRARY_DIRS}
				  ${LIBGIO_LIBRARY_DIRS})

IF (LIBGTKHOTKEY_FOUND)
	INCLUDE_DIRECTORIES (${LIBGTKHOTKEY_INCLUDE_DIRS})
	LINK_DIRECTORIES (${LIBGTKHOTKEY_LIBRARY_DIRS})
	MESSAGE ("\n-- libgtkhotkey found at ${LIBGTKHOTKEY_LIBRARY_DIRS}. Keyboard shortcut enabled.\n")

	SET (ENABLE_GTK_HOTKEY TRUE)

ELSE (LIBGTKHOTKEY_FOUND)
	MESSAGE ("\n-- libgtkhotkey not found. Keyboard shortcut disabled.\n")
ENDIF (LIBGTKHOTKEY_FOUND)

SET (ENABLE_CONTEXT_MENU TRUE)
SET (ENABLE_HELP_DOC TRUE)

CONFIGURE_FILE ("${FILE_BROWSER_APPLET_SOURCE_DIR}/src/config.h.in" 
				"${FILE_BROWSER_APPLET_SOURCE_DIR}/src/config.h")

SET (SRCS main.c
	 panel-menu-bar.c
 	 menu-browser.c
 	 utils.c
 	 preferences.c
	 context-menu.c
	 vfs.c)

ADD_EXECUTABLE (${EXEC} ${SRCS})

# it seems to link file without the dozens of libs this introduces!?
SET (LIBS ${LIBPANEL_LIBRARIES} ${LIBGLADE_LIBRARIES} ${LIBGIO_LIBRARIES} ${LIBGTKHOTKEY_LIBRARIES})
#SET (LIBS panel-applet-2 glade-2.0 gtkhotkey gio-2.0)
TARGET_LINK_LIBRARIES (${EXEC} ${LIBS})

INSTALL (TARGETS ${EXEC} DESTINATION "${CMAKE_INSTALL_LIB_DIR}")
